package com.cheejee.goodscenter.module.entity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.cheejee.goodscenter.validated.InsertGroup;
import com.cheejee.goodscenter.validated.UpdateGroup;

public class SkuCategoryProperties {
	@NotNull(message = "SKU分类属性ID不能为空" ,groups = {UpdateGroup.class})
    private Long id;

	@NotNull(message = "SKU ID不能为空" ,groups = {UpdateGroup.class, InsertGroup.class})
    private Long skuId;

	@NotNull(message = "属性模板ID不能为空" ,groups = {UpdateGroup.class, InsertGroup.class})
    private Integer categoryPropertiesTemplateId;

	@NotBlank(message = "属性名不能为空" ,groups = {UpdateGroup.class, InsertGroup.class})
	@Length(max = 200, message = "属性名称长度不能超过200字", groups = { InsertGroup.class, UpdateGroup.class })
    private String propertiesName;

	@NotBlank(message = "属性值不能为空" ,groups = {UpdateGroup.class, InsertGroup.class})
	@Length(max = 200, message = "属性值长度不能超过200字", groups = { InsertGroup.class, UpdateGroup.class })
    private String propertiesValue;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getSkuId() {
        return skuId;
    }

    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }

    public Integer getCategoryPropertiesTemplateId() {
        return categoryPropertiesTemplateId;
    }

    public void setCategoryPropertiesTemplateId(Integer categoryPropertiesTemplateId) {
        this.categoryPropertiesTemplateId = categoryPropertiesTemplateId;
    }

    public String getPropertiesName() {
        return propertiesName;
    }

    public void setPropertiesName(String propertiesName) {
        this.propertiesName = propertiesName == null ? null : propertiesName.trim();
    }

    public String getPropertiesValue() {
        return propertiesValue;
    }

    public void setPropertiesValue(String propertiesValue) {
        this.propertiesValue = propertiesValue == null ? null : propertiesValue.trim();
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", skuId=").append(skuId);
        sb.append(", categoryPropertiesTemplateId=").append(categoryPropertiesTemplateId);
        sb.append(", propertiesName=").append(propertiesName);
        sb.append(", propertiesValue=").append(propertiesValue);
        sb.append("]");
        return sb.toString();
    }
}